const mongoose = require('mongoose')

mongoose.connect('mongodb://localhost:27017/test',)

const Schema = mongoose.Schema 

const StudentSchema = new Schema({
  name:{
    type: 'string',
    required: true
  },
  gender:{
    type: 'number',
    enum:[0,1],
    default: 0,
    required: true
  },
  age:{
    type: 'number',
    required: true
  },
  hobbies:{
    type: 'string'
  },
})


module.exports = mongoose.model('Student',StudentSchema );


